cd4b224c27daf6c0acdb22990d3e2580cf44c95c,camel-bakery/bakery-integration/src/citrus/java/com/consol/citrus/samples/bakery/PlaceOrders_OK_Test.java,PlaceOrders_OK_Test,placePretzelOrder,#,63

Before Change


        send(reportingClient)
                .http()
                .method(HttpMethod.GET)
                .queryParam("type", "json");

        receive(reportingClient)
                .messageType(MessageType.JSON)
                .http()
                .status(HttpStatus.OK)
                .payload("{\"pretzel\": 1,\"bread\": \"@ignore@\",\"cake\": \"@ignore@\"}");
    }

    @CitrusTest

After Change


        send(bakeryOrderEndpoint)
                .payload("<order type=\"pretzel\"><amount>1</amount></order>");

        repeatOnError(
            send(reportingClient)
                    .http()
                    .method(HttpMethod.GET)
                    .queryParam("type", "json"),
            receive(reportingClient)
                    .messageType(MessageType.JSON)
                    .http()
                    .status(HttpStatus.OK)
                    .payload("{\"pretzel\": \"@greaterThan(0)@\",\"bread\": \"@ignore@\",\"cake\": \"@ignore@\"}")
        ).until(new IteratingConditionExpression() {
            @Override
            public boolean evaluate(int index, TestContext context) {
                return index > 10;
            }
        }).autoSleep(500L);
    }

    @CitrusTest